//
// Created by denglibin on 2021/4/11 0011.
//

#include "mountain.h"
#include "stdlib.h"
/**
 * 创建
 * @param type 1, 2
 * @return
 */
Mountain * MOUN_createMountain(char type, int mapX){
    Mountain * mountain = (Mountain*)calloc(1, sizeof(Mountain));
    mountain->type = type;
    if(type == 1){
        mountain->srcX = 0;
        mountain->srcY = 50;
        mountain->srcW = 50;
        mountain->srcH = 45;
    }
    if(type == 2){
        mountain->srcX = 50;
        mountain->srcY = 50;
        mountain->srcW = 50;
        mountain->srcH = 45;
    }
    mountain->mapX = mapX;
    mountain->mapY = 50;
    mountain->winX = mapX;
    return mountain;
}

/**
 * 释放资源
 * @param mountain
 */
void MOUN_freeMountain(Mountain* mountain){
    free(mountain);
}